package com.woniuxy.course.service.impl;

import com.woniuxy.course.entity.Knowledgepoint;
import com.woniuxy.course.mapper.KnowledgepointMapper;
import com.woniuxy.course.service.KnowledgepointService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author cyh
 * @since 2020-07-30
 */
@Service
public class KnowledgepointServiceImpl extends ServiceImpl<KnowledgepointMapper, Knowledgepoint> implements KnowledgepointService {
    @Autowired
    private KnowledgepointMapper knowledgepointMapper;
    @Override
    public List<Knowledgepoint> getKnowledgeByGrade(String grade) {
        HashMap<String, Object> columnMap = new HashMap<>();
        columnMap.put("grade_type", grade);

        List<Knowledgepoint> knowledgeByGrade = knowledgepointMapper.selectByMap(columnMap);

        return knowledgeByGrade;
    }
}
